package com.open.basic.util;

import com.open.basic.BaseResponse;
import com.open.basic.Page;
import com.open.basic.PageResponse;

import java.util.concurrent.CompletableFuture;


/**
 * @author: system
 * @Date: 2024/10/26 下午11:09
 * @Version: V1.0
 * @description: |
 */

public class ResponseUtil<T> {

    public static <T> BaseResponse<T> success() {
        return BaseResponse.success();
    }

    public static <T> BaseResponse<T> success(T result) {

        return BaseResponse.success(result);
    }


    public static <T> PageResponse<T> success(long totalCount, T result, Page page) {
        return PageResponse.success(totalCount, result, page);
    }

    public static <T> PageResponse<T> success(long totalCount, T result, int pageNo, int pageSize) {
        return PageResponse.success(totalCount, result, pageNo, pageSize);
    }

    public static <T> PageResponse<T> success(long totalCount, T result, long pageNo, long pageSize) {
        return PageResponse.success(totalCount, result, pageNo, pageSize);
    }


    public static <T> BaseResponse<T> fail(String failMessage) {
        return BaseResponse.fail(failMessage);
    }

    public static <T> BaseResponse<T> fail(String failCode, String failMessage) {
        return BaseResponse.fail(failCode, failMessage);
    }
}
